package org.easy.tool.mapper;

import org.apache.ibatis.annotations.Param;
import org.easy.tool.entity.Problem;
import org.easy.tool.entity.ProblemKnowledge;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Valley
 * @since 2024-09-04 22:51:14
 */
@Repository
public interface ProblemKnowledgeMapper extends BaseMapper<ProblemKnowledge> {

    boolean deleteByProblemId(@Param("problemId") String problemId);

    /**
     * 根据知识点id查询所有关联知识点的题目
     */
    List<ProblemKnowledge> getProblemKnowledgeByKnowledgeId(@Param("knowledgeId") String knowledgeId);

    /**
     * 根据题目id涉及的所有关联知识点
     */
    List<ProblemKnowledge> getProblemKnowledgeByProblemId(@Param("problemId") String problemId);

    /**
     * 根据题目id涉及的所有关联知识点id
     */
    List<String> getIdByProblemId(@Param("problemId") String problemId);
}
